package com.hmall.mapper;

import com.hmall.model.SysCustomer;
import com.hmall.model.SysDeptCustomer;
import com.hmall.util.MyMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SysDeptCustomerMapper extends MyMapper<SysDeptCustomer> {

    Integer selectCustomerIdByCustomerUserId(@Param("customerUserId") Integer customerUserId);

    Integer selectDealerIdByUserId(@Param("customerUserId") Integer customerUserId);

    SysDeptCustomer selectAllByCustomerUserId(@Param("customerUserId") Integer userId);

    Integer selectByCustomerId(@Param("customerId") Integer customerId);


    /**
     * 通过公司列表得到客户的用户列表
     * @param customerList 公司列表
     * @return List<Integer>
     */
    List<Integer> selectCustomerUserIdListByCustomerList(@Param("customerList") List<SysCustomer> customerList);

    /**
     * 根据用户列表得到公司数目
     * @param userIdList
     * @return
     */
    Integer selectCustomerCountByCustomerUserIdList(@Param("userIdList") List<Integer> userIdList);

    /**
     * 根据公司id得到公司下的员工的id列表
     * @param customerId
     * @return
     */
    List<Integer> selectCustomerUserIdByCustomerId(@Param("customerId") Integer customerId);
}